while true do
    io.write("> ") -- 提示符
    local input = io.read() -- 读取输入
    if input == "exit" then
        break
    end

    local a, op, b = input:match("(%d+)%s*([%+%-%*/])%s*(%d+)")
    if a and op and b then
        a, b = tonumber(a), tonumber(b)
        local result
        if op == "+" then
            result = a + b
        elseif op == "-" then
            result = a-b
        elseif op == "*" then
            result = a*b
        elseif op == "/" then
            result = b~=0 and a/b or "Error: The divisor cannot be 0"
        end
        print("Result: "..result)
    else
        print("Error Input!")
    end
end
